import http from "../../utils/http"
export interface classListItem{
       _id?:string
       name?:string
       image?:string
       type?:string
       price?:string
       sale?:number
       stock?:number
       sort?: number
       state?: number,
       del?:number,
       classifies?:string[]
}
export interface SeachParams{
    _id?:string,
    name?:string,
    classifiesId?:string
}
const goodsList = {
    // 查询用户分组数据
    // search: (data?: object) => http.post('/userGroups/search', data),
    search:(data?:object)=>http.post("/products/search",data),
    // 新增用户分组数据
    add:(data: classListItem) => http.post('/products/add', data),
    // 删除用户分组数据
    remove: (data:object) => http.delete('/products/remove', data),
    // 修改用户分组数据
    update: (data: classListItem) => http.put('/products/update', data),
    // 根据Id获取商品详情
    detailId:(data:object)=>http.get("/products/getDetailById",data)
}

export default goodsList